package com.shrct.businessprocess.project.impl;

import com.shrct.businessprocess.project.RCProjectTimerService;
import edu.fudan.mylang.pf.BaseService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.project.impl.RCProjectTimerServiceImpl")
public class RCProjectTimerServiceImpl extends BaseService implements RCProjectTimerService {
  @Scheduled(cron = "0 0 3 1 * ?")
  public void actFixTimer() {
    final com.shrct.businessprocess.project.RCProjectInternalStatus __created = com.shrct.businessprocess.project.RCProjectInternalStatus.created;
    edu.fudan.mylang.pf.IGenericQuery<com.shrct.businessprocess.project.RCProject> query=getObjectFactory().createGenericQuery(com.shrct.businessprocess.project.RCProject.class,"select e from com.shrct.businessprocess.project.impl.RCProjectImpl as e where  e.InternalStatus = :__created ").setParameter("__created",__created);
    java.util.Collection<com.shrct.businessprocess.project.RCProject> _list = query.list();
    final org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrct.businessprocess.project.RCProject> _function = new org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrct.businessprocess.project.RCProject>() {
    	public void apply(final com.shrct.businessprocess.project.RCProject it) {
    		it.actFixTimer();
    	}
    };
    org.eclipse.xtext.xbase.lib.IterableExtensions.<com.shrct.businessprocess.project.RCProject>forEach(_list, _function);
    
    
  }
  
  @Scheduled(cron = "0 0 1 * * ?")
  public void actUpdateTimer() {
    final com.shrct.businessprocess.project.RCProjectInternalStatus __created = com.shrct.businessprocess.project.RCProjectInternalStatus.created;
    edu.fudan.mylang.pf.IGenericQuery<com.shrct.businessprocess.project.RCProject> query=getObjectFactory().createGenericQuery(com.shrct.businessprocess.project.RCProject.class,"select e from com.shrct.businessprocess.project.impl.RCProjectImpl as e where  e.InternalStatus = :__created ").setParameter("__created",__created);
    java.util.Collection<com.shrct.businessprocess.project.RCProject> _list = query.list();
    final org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrct.businessprocess.project.RCProject> _function = new org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrct.businessprocess.project.RCProject>() {
    	public void apply(final com.shrct.businessprocess.project.RCProject it) {
    		it.actUpdateTimer();
    	}
    };
    org.eclipse.xtext.xbase.lib.IterableExtensions.<com.shrct.businessprocess.project.RCProject>forEach(_list, _function);
    
    
  }
}
